package com.example.learnspring.mapper;

import com.example.learnspring.entity.Dept;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface DeptMapper {
    @Select("select * from depts")
    public List<Dept> getList();

    @Delete("delete from depts where id=#{id}")
    void deleteDeptById(Integer id);

    @Insert("insert into depts (name, updateTime) values ( #{name}, #{updateTime} )")
    void addDept(Dept dept);

    @Select("select * from depts where id=#{id}")
    Dept selectDeptById(Integer id);

    void updateDept(Dept dept);
}
